ARCH 	:=
ARCH 	:= arm
ifeq ($(ARCH), arm)
CROSS_COMPILE := arm-linux-
else
CROSS_COMPILE :=
endif
CC			:= $(CROSS_COMPILE)gcc
CXX 		:= $(CROSS_COMPILE)g++
#LINK		:= $(CROSS_COMPILE)gcc
LINK		:= $(CROSS_COMPILE)g++
DEFINES 	:= -Dserver -DADDR_DEBUG -DDBG_DEBUG #-D_REENTRANT
CFLAGS		:= -O2 -Wall $(DEFINES)
CXXFLAGS	:= -O2 -Wall $(DEFINES)
LFLAGS		:= -Wl
#INCPATH	:= -I/usr/local/include
LIBS		:= #-lpthread #-L/usr/local/lib -ltest
SOURCES		:= $(wildcard *.c*)
OBJECTS		:= $(patsubst %.cpp,%.o,$(SOURCES))
OBJECTS		:= $(patsubst %.c,%.o,$(OBJECTS))
TARGET  	:= lib645.so
all: $(TARGET)
$(TARGET):$(OBJECTS)
	#$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
	$(CXX)	-fpic -shared  -o $(TARGET) $(OBJECTS)
	@echo "-----------------------------------------"
	@echo "-----------------------------------------"
.cpp.o:
	$(CXX) $(CXXFLAGS) -I.  -c $<
.c.o:
	$(CC) $(CFLAGS) -I. -c $<
	
install:
	cp $(TARGET) ../lib/
clean:
	-rm -f *.o $(TARGET) ../lib/$(TARGET)
